import io.vertx.core.http.ServerWebSocket

data class Addressee(val id: Long) {
    var usn: Int? = null
    var name: String? = null
    var head: String? = null
    var sf: Int? = 0
    var token: String? = null

    //var chs = arrayOf<Pair<String, Channel>>()
    var iamed = false
    var ws: ServerWebSocket? = null

    fun valid(): Boolean {
        return iamed
    }

    fun cleanUp() {
        ws = null
        //chs = arrayOf<Pair<String, Channel>>();
    }
}

data class Channel(val id: String, val max_history: Int = 10) {
    val members = mutableListOf<Addressee>()
    val history = arrayListOf<JToC>()
}

object ChannelMng {
    var chs = mapOf<String, Channel>()

    fun sayInChannel(m: JToC) {
    }
}
